<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>SendNetworkString</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SendNetworkString()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#006666"><b>SendNetworkString</b></font>(Connection, String$ [, Format])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Send a string to the specified client. This function can be used by both 
client and server applications. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Connection</i></td>
<td width="90%"> 
 
The connection to send the string to. 
On the server side, 'Connection' is the client which should receive this data. 
On the client side, 'Connection' is returned by <a href="opennetworkconnection.html">OpenNetworkConnection()</a>. 

 

</td></tr>
<tr><td><i>String$</i></td>
<td> 
 
The string to send. 

 

</td></tr>
<tr><td><i>Format (optional)</i></td>
<td> 
 
The string format to use when sending the string. This can be one of the following values: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Ascii</font>  : sends the strings as ASCII
  <font color="#924B72">#PB_UTF8</font>   : sends the strings as UTF8 
  <font color="#924B72">#PB_Unicode</font>: send the strings as unicode
</font></pre>

If this parameter is not specified, the string will be sent in UTF8 format if the program is compiled in 
<a href="../reference/unicode.html">unicode</a> mode and in ASCII format otherwise. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the number of bytes sent. 

 

</blockquote><p><b>Remarks</b></p><blockquote>



SendNetworkString() provides a solution to quickly send strings. The string will be sent without the 
terminating null-character, and can be received using <a href="receivenetworkdata.html">ReceiveNetworkData()</a>, after 
<a href="networkserverevent.html">NetworkServerEvent()</a> / <a href="networkclientevent.html">NetworkClientEvent()</a> returned <font color="#924B72">#PB_NetworkEvent_Data</font>). 
In <a href="../reference/unicode.html">unicode</a> mode the string is sent as UTF-8, which is processor independent (unlike UTF-16 which is tied to processor endianness). 
There is no ReceiveNetworkString() command. 

 

</blockquote><p><b>参阅</b></p><blockquote>

<a href="sendnetworkdata.html">SendNetworkData()</a>, <a href="receivenetworkdata.html">ReceiveNetworkData()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=sendnetworkdata.html>SendNetworkData()</a> - <a href=index.html>Network Index</a> - <a href=serverid.html>ServerID()</a> -&gt;



</body></html>